class Simulation {
    constructor(components) {
        this.components = components; // 系统中的所有组件
        this.isRunning = false;       // 仿真状态
    }
    
    start() {
        this.isRunning = true;
        this.run();
    }
    
    stop() {
        this.isRunning = false;
    }

    run() {
        if (!this.isRunning) return;

        // 遍历所有组件并执行其行为
        this.components.forEach(component => {
            BehaviorManager.executeBehaviors(component);
        });

        requestAnimationFrame(this.run.bind(this));
    }
}

export  default Simulation; 